import React, { forwardRef, useImperativeHandle, useState } from 'react'

const Child = forwardRef((props, ref: any) => {
    const [value, setValue] = useState(0)

    useImperativeHandle(ref, () => ({
        setValue,
        someValue: 'test'
    }))

    return (
        <div>
            <p>{value}</p>
            <input type="text" />
        </div>
    )
})

export default Child
